package calorie.com.calorie.adapter;

import android.support.annotation.Nullable;
import android.view.View;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

import calorie.com.calorie.R;
import calorie.com.calorie.response.WristBandResponce;


public class WristBandAdapter extends BaseQuickAdapter<WristBandResponce,BaseViewHolder>   {
    public WristBandAdapter(int layoutResId, @Nullable List<WristBandResponce> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, WristBandResponce item) {
        helper.setText(R.id.tv_name,item.name);
        helper.getView(R.id.tv_bind).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                //绑定手环
                mBindOnClickListener.bindClick();

            }
        });
    }

    public interface BindOnClickListener{
        void bindClick();
    }

    BindOnClickListener mBindOnClickListener;

    public void setmBindOnClickListener(BindOnClickListener mBindOnClickListener) {
        this.mBindOnClickListener = mBindOnClickListener;
    }
}
